-
-
Notifications
You must be signed in to change notification settings - Fork 281
refactor(bump): add type for out, replace function with re escape #1429
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: refactors
Are you sure you want to change the base?
refactor(bump): add type for out, replace function with re escape #1429
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## refactors #1429 +/- ##
============================================
Coverage ? 97.57%
============================================
Files ? 57
Lines ? 2680
Branches ? 0
============================================
Hits ? 2615
Misses ? 65
Partials ? 0
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
for pattern in patterns: | ||
drive, tail = os.path.splitdrive(pattern) | ||
path, _, regex = tail.partition(":") | ||
filepath = drive + path | ||
if not regex: | ||
regex = _version_to_regex(version) | ||
regex = re.escape(version) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if I understand this correctly. version
is not a regex string right? And regex
is just for substring matching?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess we want to support regex
back then 🤔 , but it's not yet a regex.
It's used in
https://commitizen-tools.github.io/commitizen/commands/bump/#version_files
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We probably could rename the regex variable or add regex support, but this PR alone looks good
for pattern in patterns: | ||
drive, tail = os.path.splitdrive(pattern) | ||
path, _, regex = tail.partition(":") | ||
filepath = drive + path | ||
if not regex: | ||
regex = _version_to_regex(version) | ||
regex = re.escape(version) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess we want to support regex
back then 🤔 , but it's not yet a regex.
It's used in
https://commitizen-tools.github.io/commitizen/commands/bump/#version_files
Description
Checklist
Code Changes
poetry all
locally to ensure this change passes linter check and testsDocumentation Changes
poetry doc
locally to ensure the documentation pages renders correctlyExpected Behavior
Steps to Test This Pull Request
Additional Context